﻿using System;

namespace 责任链模式
{
    class Program
    {
        static void Main(string[] args)
        {
            var requestTelphone = new PurchaseRequest(4000.0, "电话机");
            var requestSoftware = new PurchaseRequest(12000.0, "办公耗材");
            var requestComputers = new PurchaseRequest(140000.0, "笔记本电脑");

            Approver c1 = new President("胡总经理");
            Approver c2 = new VicePresident("李副总经理");
            Approver c3 = new Manager("张经理");

            c3.NextApprover = c2;
            c2.NextApprover = c1;

            c3.ProcessRequest(requestComputers);
            c3.ProcessRequest(requestSoftware);
            c3.ProcessRequest(requestTelphone);
        }
    }
}
